package com.test.vote.service;

import com.test.vote.mapper.PlayerDao;
import com.test.vote.pojo.Player;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class playerService {

    @Resource
    PlayerDao playerDao;

    //录入选手哦
    public int addPlayer(Player player) {
        return playerDao.insert(player);
    }

    //通过比赛Id查询选手
    public List<Player> selectPlayer(int matchId) {
        return playerDao.selectPlayer(matchId);
    }

    //通过Id查询选手
    public Player selectPlayerById(int playerId) {
        return playerDao.selectByPrimaryKey(playerId);
    }
}
